(: Converts attractionsByCity into attractionsByNames :)

<attractions>{
for $cities in doc("attractionsByCity.xml")/attractions/city
    let $attrInCity := $cities/attraction
    for $attr in $attrInCity
    order by $attr/name
    return <attraction type="{$attr/@type}">{$attr/name}{$attr/street}
            <city>{$cities/@name}</city></attraction>}
</attractions>